@extends('admin.layout', ['header' => $header])

@section('content')
    <div class="layui-card">
        <div class="layui-card-body">
            <span class="layui-breadcrumb" >
                <a href="{{ admin_url('/') }}"><i class="fa fa-dashboard"></i> {{__('Home')}}</a>
                @if ($breadcrumb)
                    @foreach($breadcrumb as $item)
                        @if (\Illuminate\Support\Arr::has($item, 'url'))
                            <a href="{{ admin_url(\Illuminate\Support\Arr::get($item, 'url')) }}">
                            @if (\Illuminate\Support\Arr::has($item, 'icon'))
                                <i class="fa fa-{{ $item['icon'] }}"></i>
                            @endif
                            {{ $item['text'] }}</a>
                        @else
                            <a href="javascript:;">
                            @if (\Illuminate\Support\Arr::has($item, 'icon'))
                                <i class="fa fa-{{ $item['icon'] }}"></i>
                            @endif
                            </i>{{ $item['text'] }}</a>
                        @endif
                    @endforeach
                @else
                    @for($i = 2; $i <= count(Request::segments()); $i++)
                        <a href="javascript:;">{{ucfirst(Request::segment($i))}}</a>
                    @endfor
                @endif
            </span>
            <span class="pull-right">
                {{ $header ?: trans('admin.title') }}
                <small>{{ $description ?: trans('admin.description') }}</small>
            </span>
        </div>
    </div>
    <div class="layui-fluid">
        @include('admin.partials.alerts')
        @include('admin.partials.exception')
        @include('admin.partials.toastr')

        @if($_view_)
            @include($_view_['view'], $_view_['data']);
        @else
            {!! $_content_ !!}
        @endif
    </div>
@endsection
